package com.tripwego.client.ui.widget.activite;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.tripwego.client.model.ActiviteModel;

public class LodgingCheckoutWidget extends LodgingWidget {

	/*
	 * Elements graphiques
	 */
	private final HTML html_title = new HTML("Name - Checkout");

	/**
	 * 
	 */
	public LodgingCheckoutWidget(ActiviteModel activiteModel) {
		super(activiteModel);

		viewPanel.setStyleName("LodgingCheckoutWidget");
		viewPanel.setSize("350px", "");

		Image image_icon = new Image(activiteModel.getIconUrl());
		viewPanel.setWidget(0, 0, image_icon);
		viewPanel.getCellFormatter().setWidth(0, 0, "1%");
		image_icon.setSize("24px", "24px");

		viewPanel.setWidget(0, 1, html_title);
		viewPanel.getCellFormatter().setWidth(0, 1, "100%");
		panel_actions.setStyleName("horizontalPanel_actions");
		panel_actions.setSpacing(2);

		viewPanel.setWidget(0, 2, panel_actions);
		panel_actions.setWidth("1%");

		panel_actions.add(image_step);
		image_step.setTitle("Point d'arr\u00EAt sur la carte");

		panel_actions.add(image_update);
		image_update.setTitle("Modifier l'activit\u00E9");
		panel_actions.add(image_delete);

		image_delete.setTitle("Supprimer l'activit\u00E9");
		viewPanel.getCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_TOP);
		viewPanel.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);

		String title = activiteModel.getNom().concat(" - Checkout");
		html_title.setHTML("<b>".concat(title).concat("</b>"));
	}
}
